package com.ztgf.commodity.service;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.ztgf.commodity.common.config.YmlConfig;
import com.ztgf.commodity.mapper.CommoditySpecificationAttrMapper;
import com.ztgf.commodity.models.bo.CommoditySpecificationAttrSaveBO;
import com.ztgf.commodity.models.dto.CommoditySpecificationAttrDTO;
import com.ztgf.commodity.models.service.ICommoditySpecificationAttrService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * author: chenyu.wang
 * date: 2020-06-01 14:51
 * Description:
 */
@DubboService
public class CommoditySpecificationAttrServiceImpl extends ServiceImpl<CommoditySpecificationAttrMapper, CommoditySpecificationAttrDTO>
        implements ICommoditySpecificationAttrService {

    @Resource
    private YmlConfig ymlConfig;

    @Override
    public boolean add(CommoditySpecificationAttrSaveBO bo) {
        CommoditySpecificationAttrDTO saveDto = new CommoditySpecificationAttrDTO();
        saveDto.setSpecificationId(bo.getSpecificationId());
        saveDto.setAttrName(bo.getAttrName());
        saveDto.setId(ymlConfig.getPkId());
        return this.insert(saveDto);
    }
}
